package com.alone.openai.api.core.param;

import com.alone.openai.api.core.ApiConstant;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

/**
 * @author Alone
 * @date 2023/3/23 2:08 下午
 */
@Data
public class ImageGenerationParam {

    public static ImageGenerationParam of(String msg) {
        ImageGenerationParam res = new ImageGenerationParam();
        res.setPrompt(msg);
        return res;
    }

    /**
     * Required
     * <p>
     * A text description of the desired image(s). The maximum length is 1000 characters.
     * <p>
     * 所需图像的文本描述。最大长度为1000个字符。
     */
    private String prompt;

    /**
     * The number of images to generate. Must be between 1 and 10.
     * <p>
     * 要生成的图像数量。必须在1到10之间。
     */
    private int n = 1;

    /**
     * The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024.
     * <p>
     * 生成的图像的大小。必须是256x256、512x512或1024x1024之一。
     */
    private String size = ApiConstant.IMG_SIZE_512;

    /**
     * The format in which the generated images are returned. Must be one of url or b64_json.
     * <p>
     * 返回生成的图像的格式。必须是url或b64_json之一。
     */
    private String response_format = ApiConstant.IMG_RESPONSE_URL;

    /**
     * A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.
     * <p>
     * 代表您的最终用户的唯一标识符，可以帮助OpenAI监视和检测滥用行为。
     * <p>
     * https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids
     */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private String user = null;

}
